﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using Classes;

namespace FlightSystemControlLayer
{
    class Program
    {
        //static int noOfSeatsInOrder = 1;
        //// static Connection item;
        //static DateTime departureTime = new DateTime(2010, 11, 21, 13, 50, 00);
        //static Object ob = new Object();
        SearcherCtr searcherCtr;
        static void Main(string[] args)
        {
            
            //BookingCtr booker = new BookingCtr();
            //City f = searcherCtr.getCityList()[0];
            //City t = searcherCtr.getCityList()[4];

            new Program();
           
         
           
            //    //item = searcherCtr.MakeASearch(f, t).GetConnectionList()[0];

            //    //for (int i = 0; i < 5; i++)
            //    //{
            //    //    new Thread(Program.MultiTest).Start();
            //    //}
            //    Console.ReadLine();
            //   // methods below is the representation of Client output invoking search


            //    int nr = 1;

            //    foreach (Connection item in searcherCtr.MakeASearch(f, t, noOfSeatsInOrder, departureTime).GetConnectionList())
            //    {
            //        Console.WriteLine("-------" + nr++ + "--------");
            //        foreach (Flight fl in item.FlightList())
            //        {
            //            Console.WriteLine(fl.From.Name + " > " + fl.To.Name);

            //        }
            //        Console.WriteLine("To book write 1 to see next 0");
            //        int bookNr = Convert.ToInt32(Console.ReadLine());
            //        if (bookNr == 0)
            //        {

            //        }
            //        else
            //        {
            //            Console.WriteLine("Booking was initiated   click Enter to exit");
            //            booker.Book(item, noOfSeatsInOrder, "name", "lastname", "address", "country", "phone", "email", "passport");


            //            break;

            //        }
            //    }

            //      Console.ReadLine();

            //} 


            //private static void MultiTest() {

            //    BookingCtr booker = new BookingCtr();
            //    booker.Book(item, 100, "name", "lastname", "address", "country", "phone", "email", "passport");

            //}

        }
        public Program() {
            searcherCtr = new SearcherCtr();
            for (int i = 0; i < 500; i++)
            {
                Thread t = new Thread(getlisto);
                t.Start();
            }

            Console.ReadLine();
        }
        public void getlisto()
        {

            Console.WriteLine(searcherCtr.getCityList().Count); 
            


        }

    }
}
